VtRadioBox
Create a RadioBox widget
Syntax
VtRadioBox object_name [options]
Description
Creates a RadioBox. Returns the widget name.
Options
- -autoSelect Boolean (CS)
- Works only in character mode. If autoSelect is
True, buttons within the RadioBox are automatically selected when
traversing to them. In effect, the selection follows the focus when
moving between ToggleButtons with the arrow keys. This provides a
functionality similar to the Microsoft Windows(TM) equivalent of a
RadioBox. The default is False.
- -callback cmd (C)
- Specifies that the callback cmd is called when a
ToggleButton in the RadioBox is selected. This overrides any callback
set for the contained ToggleButtons.
Additional callback keys
- (selectedWidget
- selected ToggleButton)
- value
- the selected toggle button
- -horizontal (CS)
- Specifies that ToggleButtons should be arranged horizontally within the RadioBox.
- -numColumns integer (CS)
- Specifies that the RadioBox should arrange its contents in integer columns.
- -spacing integer (CS)
- Specifies the spacing between the RadioBox's contents.
- -value widgetName (CSG)
- Selects the ToggleButton specified by widgetName.
- -vertical (CS)
- Specifies that ToggleButtons should be arranged vertically
within the RadioBox.
Example
The following code produces a RadioBox containing three ToggleButtons.
set app [VtOpen "radioboxdemo"]
set form [VtFormDialog $app.form -title "VtRadioBox Demo" ]
set radiobox [VtRadioBox $form.radiobox \
-leftSide FORM \
-rightSide FORM]
set apple [VtToggleButton $radiobox.apple \
-label "Apple" ]
set orange [VtToggleButton $radiobox.orange \
-label "Orange" ]
set kumquat [VtToggleButton $radiobox.kumquat \
-label "Kumquat" ]
VtShow $form
VtMainLoop
This code produces the following:
See also: